import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:xin_he/page/adopt/xin_he_adopt_num_select/xin_he_adopt_num_select_view.dart';
import 'package:xin_he/page/adopt/xin_he_adopt_payment/xin_he_adopt_payment_view.dart';
import 'package:xin_he/page/adopt/xin_he_adopt_records/xin_he_adopt_records_view.dart';
import 'package:xin_he/page/category/xin_he_category/xin_he_category_view.dart';
import 'package:xin_he/page/category/xin_he_category/xin_he_sub_category/xin_he_sub_category_view.dart';
import 'package:xin_he/page/goods/xin_he_flash_sale_goods_detail/xin_he_flash_sale_goods_detail_view.dart';
import 'package:xin_he/page/goods/xin_he_good_detail/xin_he_good_detail_view.dart';
import 'package:xin_he/page/goods/xin_he_group_purchase_goods_detail/xin_he_group_purchase_goods_detail_view.dart';
import 'package:xin_he/page/home/xin_he_flash_sale/xin_he_flash_sale_view.dart';
import 'package:xin_he/page/home/xin_he_group_purchase/xin_he_group_purchase_view.dart';
import 'package:xin_he/page/home/xin_he_search/xin_he_search_view.dart';
import 'package:xin_he/page/login/xin_he_forget_pwd/xin_he_forget_pwd_view.dart';
import 'package:xin_he/page/login/xin_he_login/xin_he_login_view.dart';
import 'package:xin_he/page/login/xin_he_register/xin_he_register_view.dart';
import 'package:xin_he/page/mine/xin_he_adress_management/xin_he_add_address/xin_he_add_address_view.dart';
import 'package:xin_he/page/mine/xin_he_adress_management/xin_he_adress_management_view.dart';
import 'package:xin_he/page/mine/xin_he_apply_sale_after/xin_he_apply_back_goods_and_money/xin_he_apply_back_goods_and_money_view.dart';
import 'package:xin_he/page/mine/xin_he_apply_sale_after/xin_he_apply_sale_after_list/xin_he_apply_sale_after_list_view.dart';
import 'package:xin_he/page/mine/xin_he_apply_sale_after/xin_he_apply_sale_after_view.dart';
import 'package:xin_he/page/mine/xin_he_bank_management/xin_he_add_bank/xin_he_add_bank_view.dart';
import 'package:xin_he/page/mine/xin_he_bank_management/xin_he_bank_management_view.dart';
import 'package:xin_he/page/mine/xin_he_edit_prifile/xin_he_edit_prifile_view.dart';
import 'package:xin_he/page/mine/xin_he_mine/x_in_he_my_favor/x_in_he_my_favor_view.dart';
import 'package:xin_he/page/mine/xin_he_mine/xin_he_my_coupon/xin_he_my_coupon_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_cast_fee_redbag/xin_he_mine_cast_fee_redbag_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_cloud_cha_zi/xin_he_mine_cloud_cha_zi_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_left_money/xin_he_mine_left_money_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_oil_card_account/xin_he_mine_oil_card_account_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_orders/xin_he_group_purchase_order_detail/xin_he_group_purchase_order_detail_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_orders/xin_he_group_purchase_orders/xin_he_group_purchase_orders_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_orders/xin_he_mine_order_detail/xin_he_mine_order_detail_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_orders/xin_he_mine_orders_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_real_name_auth/xin_he_mine_real_name_auth_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_team/xin_he_mine_team_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_withdraw/xin_he_mine_withdraw_records/xin_he_mine_withdraw_records_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_withdraw/xin_he_mine_withdraw_view.dart';
import 'package:xin_he/page/mine/xin_he_mine_work_space/xin_he_mine_work_space_view.dart';
import 'package:xin_he/page/mine/xin_he_oil_card_exchange/xin_he_oil_card_exchange_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_enter/xin_he_seller_enter_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_management/xin_he_seller_management_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_management/xin_he_seller_member/xin_he_seller_member_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_management/xin_he_seller_my_profit/xin_he_seller_my_profit_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_management/xin_he_seller_orders/xin_he_seller_orders_view.dart';
import 'package:xin_he/page/mine/xin_he_seller_shop/xin_he_seller_shop_view.dart';
import 'package:xin_he/page/roots/xin_he_root_page.dart';
import 'package:xin_he/page/roots/xin_he_splash/xin_he_splash_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_goods_payment/xin_he_goods_payment_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_goods_payment/xin_he_instant_buy/xin_he_instant_buy_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_goods_payment/xin_he_pay_success/xin_he_pay_success_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_instant_pay/xin_he_instant_pay_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_nearby_shop/xin_he_nearby_shop_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_place_order_success/xin_he_place_order_success_view.dart';
import 'package:xin_he/page/shopping_car/xin_he_shopping_car/xin_he_shopping_car_view.dart';
import 'package:xin_he/routes/xin_he_route_middlemare.dart';

import '../page/goods/xin_he_photo_gallery_scan/xin_he_photo_gallery_scan_view.dart';
import '../page/mine/xin_he_invite_friend/xin_he_invite_friend_view.dart';

abstract class XinHeRoutes {

  ///启动页
  static const init = '/';

  ///根页面(首页主页面)
  static const root = '/root';

  ///首页
  static const home = '/home';

  ///分类
  static const category  = '/category';
  static const subCategory  = '/category/sub';

  ///认养
  static const adopt = '/adopt';

  ///购物车
  static const shopping_car = '/shopping_car';

  ///我的
  static const mine = '/mine';

  ///登录
  static const login = '/login';

  ///注册
  static const register = '/register';
  static const forgetPwd = '/login/forget_pwd';

  ///search
  static const search = '/search';
  static const goodsDetail = '/good_detail';
  static const goodsDetailBannerScan = '/good_detail/scan';

  ///确认订单
  static const sureOrder = '/cart/sure_order';

  ///我的订单
  static const myOrders = '/mine/orders';

  static const nearbyShop = '/cart/payment/nearby_shop';

  ///申请售后
  static const applySaleAfter = '/mine/apply_sale_after';
  static const applyBackMoneyAndGoods = '/mine/sale_after/goods_money';
  static const applySaleAfterList = '/mine/apply_sale_after_list';
  ///订单详情
  static const orderDetail = '/mine/order_detail';
  static const myFavor = '/mine/favor';
  static const myCoupons = '/mine/coupons';

  static const paySuccess = '/cart/pay_success/';

  ///限时抢购
  static const flashSale = '/home/flash_sale';
  static const groupPurchase = '/home/group_purchase';
  static const flashSaleDetail = '/home/flash_sale_detail';
  static const groupPurchaseDetail = '/home/group_purchase_detail';


  ///商家入驻
  static const sellerEnter = '/mine/seller_enter';

  static const sellerManagement = '/mine/sell_managerment';

  static const sellerOrders = '/mine/sell_managerment/orders';
  static const sellerMyProfits = '/mine/sell_managerment/my_profits';
  static const sellerMember = '/mine/sell_managerment/members';


  static const sellerShop = '/mine/seller_shop';

  ///团购订单
  static const groupPurchaseOrders = '/mine/group_purchase_orders';
  ///团购订单详情
  static const groupPurchaseOrdersDetail = '/mine/group_purchase_order_detail';


  static const adoptRecords = '/adopt/adopt_records';

  ///实名认证
  static const realNameAuth = '/mine/real_name_auth';

  ///余额
 static const leftMoney = '/mine/left_money';
 ///提现
 static const withdraw = '/mine/withdraw';
 static const withdrawRecords = '/mine/withdraw_records';

 static const myCloudChaZi = '/mine/cloud_chazi';
 static const oilCard = '/mine/oil_card';
 static const castFeeRedbag = '/mine/cast_fee_redbag';

 static const myTeam = '/mine/my_team';
 static const addressManagement = '/mine/addressManagement';
 static const editProfile = '/mine/edit_profile';

  static const addAddress = '/mine/add_address';
  static const inviteFriend = '/mine/invite_friend';

  static const adoptPayment = '/mine/adopt_payment';
  static const workSpace = '/mine/work_space';
  static const oilExchange = '/mine/oil_exchange';

  static const instantBuy = '/home/good_detail/buy_now';
  static const instantPay = '/home/good_detail/pay_now';

 static const bankManagement = '/mine/bank';
  static const addBank = '/mine/bank_add';

  static const placeOrderSuccess = '/payment_order/place';
}

abstract class  XinHePages {

  static final pages = [

    GetPage(
        name: XinHeRoutes.init,
        page: ()=> XinHeSplashPage(),
        middlewares: [
            NormalAuth(),
        ]
    ),

    GetPage(
        name: XinHeRoutes.root,
        page: ()=> XinHeRootPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.home,
        page: ()=> Container(),
        middlewares: [
          NormalAuth(),

        ]
    ),


    GetPage(
        name: XinHeRoutes.category,
        page: ()=> XinHeCategoryPage(),
        preventDuplicates: false,
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.adopt,
        page: ()=> Container(),
        middlewares: [
          NormalAuth(),

        ]
    ),
    GetPage(
        name: XinHeRoutes.shopping_car,
        page: ()=> XinHeShoppingCarPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),
    GetPage(
        name: XinHeRoutes.mine,
        page: ()=> Container(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.login,
        page: ()=> XinHeLoginPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.register,
        page: ()=> XinHeRegisterPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.search,
        page: ()=> XinHeSearchPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.goodsDetail,
        page: ()=> XinHeGoodDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.goodsDetail,
        page: ()=> XinHeGoodDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.forgetPwd,
        page: ()=> XinHeForgetPwdPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.goodsDetailBannerScan,
        page: ()=> XinHePhotoGalleryScanPage(),
        middlewares: [
          NormalAuth(),

        ],
      popGesture: false,
      transition: Transition.fadeIn
    ),



    GetPage(
        name: XinHeRoutes.sureOrder,
        page: ()=> XinHeGoodsPaymentPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.myOrders,
        page: ()=> XinHeMineOrdersPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.nearbyShop,
        page: ()=> XinHeNearbyShopPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.applySaleAfter,
        page: ()=> XinHeApplySaleAfterPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.applyBackMoneyAndGoods,
        page: ()=> XinHeApplyBackGoodsAndMoneyPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.orderDetail,
        page: ()=> XinHeMineOrderDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.myCoupons,
        page: ()=> XinHeMyCouponPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.myFavor,
        page: ()=> XInHeMyFavorPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.applySaleAfterList,
        page: ()=> XinHeApplySaleAfterListPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.paySuccess,
        page: ()=> XinHePaySuccessPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.flashSale,
        page: ()=> XinHeFlashSalePage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.groupPurchase,
        page: ()=> XinHeGroupPurchasePage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerEnter,
        page: ()=> XinHeSellerEnterPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerManagement,
        page: ()=> XinHeSellerManagementPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerOrders,
        page: ()=> XinHeSellerOrdersPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerMyProfits,
        page: ()=> XinHeSellerMyProfitPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerMember,
        page: ()=> XinHeSellerMemberPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.sellerShop,
        page: ()=> XinHeSellerShopPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),
    GetPage(
        name: XinHeRoutes.flashSaleDetail,
        page: ()=> XinHeFlashSaleGoodsDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.groupPurchaseDetail,
        page: ()=> XinHeGroupPurchaseGoodsDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.groupPurchaseOrdersDetail,
        page: ()=> XinHeGroupPurchaseOrderDetailPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),
    GetPage(
        name: XinHeRoutes.groupPurchaseOrders,
        page: ()=> XinHeGroupPurchaseOrdersPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.adoptRecords,
        page: ()=> XinHeAdoptRecordsPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.realNameAuth,
        page: ()=> XinHeMineRealNameAuthPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.withdraw,
        page: ()=> XinHeMineWithdrawPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.withdrawRecords,
        page: ()=> XinHeMineWithdrawRecordsPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.leftMoney,
        page: ()=> XinHeMineLeftMoneyPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.oilCard,
        page: ()=> XinHeMineOilCardAccountPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),
    GetPage(
        name: XinHeRoutes.myCloudChaZi,
        page: ()=> XinHeMineCloudChaZiPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),


    GetPage(
        name: XinHeRoutes.editProfile,
        page: ()=> XinHeEditPrifilePage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.addressManagement,
        page: ()=> XinHeAdressManagementPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.myTeam,
        page: ()=> XinHeMineTeamPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.castFeeRedbag,
        page: ()=> XinHeMineCastFeeRedbagPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.addAddress,
        page: ()=> XinHeAddAddressPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.inviteFriend,
        page: ()=> XinHeInviteFriendPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.adoptPayment,
        page: ()=> XinHeAdoptPaymentPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.workSpace,
        page: ()=> XinHeMineWorkSpacePage(),
        middlewares: [
          NormalAuth(),
          LoginMiddleware(priority: 1),

        ]
    ),

    GetPage(
        name: XinHeRoutes.subCategory,
        page: ()=> XinHeSubCategoryPage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    GetPage(
        name: XinHeRoutes.oilExchange,
        page: ()=> XinHeOilCardExchangePage(),
        middlewares: [
          NormalAuth(),

        ]
    ),

    // GetPage(
    //     name: XinHeRoutes.instantPay,
    //     page: ()=> XinHeInstantPayPage(),
    //     middlewares: [
    //       NormalAuth(),
    //
    //     ]
    // ),


    GetPage(
        name: XinHeRoutes.bankManagement,
        page: ()=> XinHeBankManagementPage(),
        middlewares: [
          NormalAuth(),
        ]
    ),

    GetPage(
        name: XinHeRoutes.addBank,
        page: ()=> XinHeAddBankPage(),
        middlewares: [
          NormalAuth(),
        ]
    ),
    GetPage(
        name: XinHeRoutes.placeOrderSuccess,
        page: ()=> XinHePlaceOrderSuccessPage(),
        middlewares: [
          NormalAuth(),
        ]
    )


  ];

}
